import request from '@/utils/request'
import qs from 'qs'
// 查询试验主报告分页信息
export const getzhubaogaolistapi = params => request.get('pio-microservice-biz/pio/trial-report/base/page', { params })
// 保存试验主报告
export const postbaocunzhubaogaoapi = data => request.post('pio-microservice-biz/pio/trial-report/base/save', data)
// 初始化试验子报告
export const getchushihuazibaogaoapi = data => request.post(`pio-microservice-biz/pio/trial-report/child/init?id=${data.id}&orgNo=${data.orgNo}&trialType=${data.trialType}`)
// 删除试验主报告
export const delshiyanzhubaogaoapi = data => request.post(`pio-microservice-biz/pio/trial-report/base/delete?id=${data.id}`)
// 查询试验子报告分页信息
export const getzhibaogaolistapi = params => request.get('pio-microservice-biz/pio/trial-report/child/page', { params })
// 提交试验主报告
export const posttijiaoapi = data => request.post(`pio-microservice-biz/pio/trial-report/base/submit?id=${data.id}`)
// 审核试验主报告
export const postshenhezhubaogaoapi = data => request.post('pio-microservice-biz/pio/trial-report/base/check', qs.stringify(data))
// 删除试验子报告
export const delzhibaogaoapi = data => request.post(`pio-microservice-biz/pio/trial-report/child/delete?id=${data.id}`)
// 保存试验子报告
export const postshiyanzhibaogaoapi = data => request.post('pio-microservice-biz/pio/trial-report/child/save', data)
// 上传文件
export const postuploadapi=(id,data)=>request.post(`pio-microservice-biz/pio/trial-report/child/upload?id=${id}`,data,{headers: {
  'Content-Type': 'multipart/form-data'
}
})
// 下载附件
export const postuploadfujianapi=data=>request.post(`pio-microservice-biz/cbm/attachment/download?id=${data.id}`)